3.245 \(\int (a+a \sin (e+f x)) (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx\)

Optimal. Leaf size=213 \[ -\frac{a \left (4 A d \left (c^2+3 c d+d^2\right )-B \left (-4 c^2 d+c^3-8 c d^2-4 d^3\right )\right ) \cos (e+f x)}{6 d f}+\frac{1}{8} a x \left (4 A \left (2 c^2+2 c d+d^2\right )+B \left (4 c^2+8 c d+3 d^2\right )\right )-\frac{a \left (3 d^2 (4 A+3 B)-2 c (B c-4 d (A+B))\right ) \sin (e+f x) \cos (e+f x)}{24 f}+\frac{a (B c-4 d (A+B)) \cos (e+f x) (c+d \sin (e+f x))^2}{12 d f}-\frac{a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f} \]

[Out]

(a*(4*A*(2*c^2 + 2*c*d + d^2) + B*(4*c^2 + 8*c*d + 3*d^2))*x)/8 - (a*(4*A*d*(c^2 + 3*c*d + d^2) - B*(c^3 - 4*c
^2*d - 8*c*d^2 - 4*d^3))*Cos[e + f*x])/(6*d*f) - (a*(3*(4*A + 3*B)*d^2 - 2*c*(B*c - 4*(A + B)*d))*Cos[e + f*x]
*Sin[e + f*x])/(24*f) + (a*(B*c - 4*(A + B)*d)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(12*d*f) - (a*B*Cos[e + f*
x]*(c + d*Sin[e + f*x])^3)/(4*d*f)

________________________________________________________________________________________

Rubi [A]  time = 0.360404, antiderivative size = 213, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.121, Rules used = {2968, 3023, 2753, 2734} \[ -\frac{a \left (4 A d \left (c^2+3 c d+d^2\right )-B \left (-4 c^2 d+c^3-8 c d^2-4 d^3\right )\right ) \cos (e+f x)}{6 d f}+\frac{a \left (-8 c d (A+B)-3 d^2 (4 A+3 B)+2 B c^2\right ) \sin (e+f x) \cos (e+f x)}{24 f}+\frac{1}{8} a x \left (4 A \left (2 c^2+2 c d+d^2\right )+B \left (4 c^2+8 c d+3 d^2\right )\right )+\frac{a (B c-4 d (A+B)) \cos (e+f x) (c+d \sin (e+f x))^2}{12 d f}-\frac{a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f} \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[e + f*x])*(A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2,x]

[Out]

(a*(4*A*(2*c^2 + 2*c*d + d^2) + B*(4*c^2 + 8*c*d + 3*d^2))*x)/8 - (a*(4*A*d*(c^2 + 3*c*d + d^2) - B*(c^3 - 4*c
^2*d - 8*c*d^2 - 4*d^3))*Cos[e + f*x])/(6*d*f) + (a*(2*B*c^2 - 8*(A + B)*c*d - 3*(4*A + 3*B)*d^2)*Cos[e + f*x]
*Sin[e + f*x])/(24*f) + (a*(B*c - 4*(A + B)*d)*Cos[e + f*x]*(c + d*Sin[e + f*x])^2)/(12*d*f) - (a*B*Cos[e + f*
x]*(c + d*Sin[e + f*x])^3)/(4*d*f)

Rule 2968

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x
]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]

Rule 3023

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*
(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x]
, x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 2753

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(d
*Cos[e + f*x]*(a + b*Sin[e + f*x])^m)/(f*(m + 1)), x] + Dist[1/(m + 1), Int[(a + b*Sin[e + f*x])^(m - 1)*Simp[
b*d*m + a*c*(m + 1) + (a*d*m + b*c*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*
c - a*d, 0] && NeQ[a^2 - b^2, 0] && GtQ[m, 0] && IntegerQ[2*m]

Rule 2734

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((2*a*c
+ b*d)*x)/2, x] + (-Simp[((b*c + a*d)*Cos[e + f*x])/f, x] - Simp[(b*d*Cos[e + f*x]*Sin[e + f*x])/(2*f), x]) /;
 FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rubi steps

\begin{align*} \int (a+a \sin (e+f x)) (A+B \sin (e+f x)) (c+d \sin (e+f x))^2 \, dx &=\int (c+d \sin (e+f x))^2 \left (a A+(a A+a B) \sin (e+f x)+a B \sin ^2(e+f x)\right ) \, dx\\ &=-\frac{a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}+\frac{\int (c+d \sin (e+f x))^2 (a (4 A+3 B) d-a (B c-4 (A+B) d) \sin (e+f x)) \, dx}{4 d}\\ &=\frac{a (B c-4 (A+B) d) \cos (e+f x) (c+d \sin (e+f x))^2}{12 d f}-\frac{a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}+\frac{\int (c+d \sin (e+f x)) \left (a d (12 A c+7 B c+8 A d+8 B d)-a \left (2 B c^2-8 (A+B) c d-3 (4 A+3 B) d^2\right ) \sin (e+f x)\right ) \, dx}{12 d}\\ &=\frac{1}{8} a \left (4 A \left (2 c^2+2 c d+d^2\right )+B \left (4 c^2+8 c d+3 d^2\right )\right ) x-\frac{a \left (4 A d \left (c^2+3 c d+d^2\right )-B \left (c^3-4 c^2 d-8 c d^2-4 d^3\right )\right ) \cos (e+f x)}{6 d f}+\frac{a \left (2 B c^2-8 (A+B) c d-3 (4 A+3 B) d^2\right ) \cos (e+f x) \sin (e+f x)}{24 f}+\frac{a (B c-4 (A+B) d) \cos (e+f x) (c+d \sin (e+f x))^2}{12 d f}-\frac{a B \cos (e+f x) (c+d \sin (e+f x))^3}{4 d f}\\ \end{align*}

Mathematica [A]  time = 1.10146, size = 185, normalized size = 0.87 \[ \frac{a (\sin (e+f x)+1) \left (3 \left (4 f x \left (4 A \left (2 c^2+2 c d+d^2\right )+B \left (4 c^2+8 c d+3 d^2\right )\right )-8 \left (A d (2 c+d)+B (c+d)^2\right ) \sin (2 (e+f x))+B d^2 \sin (4 (e+f x))\right )-24 \left (A \left (4 c^2+8 c d+3 d^2\right )+B \left (4 c^2+6 c d+3 d^2\right )\right ) \cos (e+f x)+8 d (A d+B (2 c+d)) \cos (3 (e+f x))\right )}{96 f \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[e + f*x])*(A + B*Sin[e + f*x])*(c + d*Sin[e + f*x])^2,x]

[Out]

(a*(1 + Sin[e + f*x])*(-24*(B*(4*c^2 + 6*c*d + 3*d^2) + A*(4*c^2 + 8*c*d + 3*d^2))*Cos[e + f*x] + 8*d*(A*d + B
*(2*c + d))*Cos[3*(e + f*x)] + 3*(4*(4*A*(2*c^2 + 2*c*d + d^2) + B*(4*c^2 + 8*c*d + 3*d^2))*f*x - 8*(B*(c + d)
^2 + A*d*(2*c + d))*Sin[2*(e + f*x)] + B*d^2*Sin[4*(e + f*x)])))/(96*f*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^2
)

________________________________________________________________________________________

Maple [A]  time = 0.056, size = 274, normalized size = 1.3 \begin{align*}{\frac{1}{f} \left ( -A{c}^{2}a\cos \left ( fx+e \right ) +2\,Acda \left ( -1/2\,\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) +1/2\,fx+e/2 \right ) -{\frac{A{d}^{2}a \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) }{3}}+B{c}^{2}a \left ( -{\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) -{\frac{2\,Bcda \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) }{3}}+B{d}^{2}a \left ( -{\frac{\cos \left ( fx+e \right ) }{4} \left ( \left ( \sin \left ( fx+e \right ) \right ) ^{3}+{\frac{3\,\sin \left ( fx+e \right ) }{2}} \right ) }+{\frac{3\,fx}{8}}+{\frac{3\,e}{8}} \right ) +A{c}^{2}a \left ( fx+e \right ) -2\,Acda\cos \left ( fx+e \right ) +A{d}^{2}a \left ( -{\frac{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }{2}}+{\frac{fx}{2}}+{\frac{e}{2}} \right ) -B{c}^{2}a\cos \left ( fx+e \right ) +2\,Bcda \left ( -1/2\,\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) +1/2\,fx+e/2 \right ) -{\frac{B{d}^{2}a \left ( 2+ \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) \cos \left ( fx+e \right ) }{3}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x)

[Out]

1/f*(-A*c^2*a*cos(f*x+e)+2*A*c*d*a*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1/3*A*d^2*a*(2+sin(f*x+e)^2)*cos
(f*x+e)+B*c^2*a*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-2/3*B*c*d*a*(2+sin(f*x+e)^2)*cos(f*x+e)+B*d^2*a*(-1
/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e)+A*c^2*a*(f*x+e)-2*A*c*d*a*cos(f*x+e)+A*d^2*a*(-1/2*
sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-B*c^2*a*cos(f*x+e)+2*B*c*d*a*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)-1
/3*B*d^2*a*(2+sin(f*x+e)^2)*cos(f*x+e))

________________________________________________________________________________________

Maxima [A]  time = 0.986382, size = 356, normalized size = 1.67 \begin{align*} \frac{96 \,{\left (f x + e\right )} A a c^{2} + 24 \,{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} B a c^{2} + 48 \,{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} A a c d + 64 \,{\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} B a c d + 48 \,{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} B a c d + 32 \,{\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} A a d^{2} + 24 \,{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} A a d^{2} + 32 \,{\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} B a d^{2} + 3 \,{\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} B a d^{2} - 96 \, A a c^{2} \cos \left (f x + e\right ) - 96 \, B a c^{2} \cos \left (f x + e\right ) - 192 \, A a c d \cos \left (f x + e\right )}{96 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algorithm="maxima")

[Out]

1/96*(96*(f*x + e)*A*a*c^2 + 24*(2*f*x + 2*e - sin(2*f*x + 2*e))*B*a*c^2 + 48*(2*f*x + 2*e - sin(2*f*x + 2*e))
*A*a*c*d + 64*(cos(f*x + e)^3 - 3*cos(f*x + e))*B*a*c*d + 48*(2*f*x + 2*e - sin(2*f*x + 2*e))*B*a*c*d + 32*(co
s(f*x + e)^3 - 3*cos(f*x + e))*A*a*d^2 + 24*(2*f*x + 2*e - sin(2*f*x + 2*e))*A*a*d^2 + 32*(cos(f*x + e)^3 - 3*
cos(f*x + e))*B*a*d^2 + 3*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*e))*B*a*d^2 - 96*A*a*c^2*cos(f*x
 + e) - 96*B*a*c^2*cos(f*x + e) - 192*A*a*c*d*cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 2.0495, size = 402, normalized size = 1.89 \begin{align*} \frac{8 \,{\left (2 \, B a c d +{\left (A + B\right )} a d^{2}\right )} \cos \left (f x + e\right )^{3} + 3 \,{\left (4 \,{\left (2 \, A + B\right )} a c^{2} + 8 \,{\left (A + B\right )} a c d +{\left (4 \, A + 3 \, B\right )} a d^{2}\right )} f x - 24 \,{\left ({\left (A + B\right )} a c^{2} + 2 \,{\left (A + B\right )} a c d +{\left (A + B\right )} a d^{2}\right )} \cos \left (f x + e\right ) + 3 \,{\left (2 \, B a d^{2} \cos \left (f x + e\right )^{3} -{\left (4 \, B a c^{2} + 8 \,{\left (A + B\right )} a c d +{\left (4 \, A + 5 \, B\right )} a d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{24 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algorithm="fricas")

[Out]

1/24*(8*(2*B*a*c*d + (A + B)*a*d^2)*cos(f*x + e)^3 + 3*(4*(2*A + B)*a*c^2 + 8*(A + B)*a*c*d + (4*A + 3*B)*a*d^
2)*f*x - 24*((A + B)*a*c^2 + 2*(A + B)*a*c*d + (A + B)*a*d^2)*cos(f*x + e) + 3*(2*B*a*d^2*cos(f*x + e)^3 - (4*
B*a*c^2 + 8*(A + B)*a*c*d + (4*A + 5*B)*a*d^2)*cos(f*x + e))*sin(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 3.64629, size = 571, normalized size = 2.68 \begin{align*} \begin{cases} A a c^{2} x - \frac{A a c^{2} \cos{\left (e + f x \right )}}{f} + A a c d x \sin ^{2}{\left (e + f x \right )} + A a c d x \cos ^{2}{\left (e + f x \right )} - \frac{A a c d \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{2 A a c d \cos{\left (e + f x \right )}}{f} + \frac{A a d^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac{A a d^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac{A a d^{2} \sin ^{2}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{A a d^{2} \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} - \frac{2 A a d^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac{B a c^{2} x \sin ^{2}{\left (e + f x \right )}}{2} + \frac{B a c^{2} x \cos ^{2}{\left (e + f x \right )}}{2} - \frac{B a c^{2} \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{2 f} - \frac{B a c^{2} \cos{\left (e + f x \right )}}{f} + B a c d x \sin ^{2}{\left (e + f x \right )} + B a c d x \cos ^{2}{\left (e + f x \right )} - \frac{2 B a c d \sin ^{2}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{B a c d \sin{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{4 B a c d \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac{3 B a d^{2} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac{3 B a d^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac{3 B a d^{2} x \cos ^{4}{\left (e + f x \right )}}{8} - \frac{5 B a d^{2} \sin ^{3}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{8 f} - \frac{B a d^{2} \sin ^{2}{\left (e + f x \right )} \cos{\left (e + f x \right )}}{f} - \frac{3 B a d^{2} \sin{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} - \frac{2 B a d^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} & \text{for}\: f \neq 0 \\x \left (A + B \sin{\left (e \right )}\right ) \left (c + d \sin{\left (e \right )}\right )^{2} \left (a \sin{\left (e \right )} + a\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))**2,x)

[Out]

Piecewise((A*a*c**2*x - A*a*c**2*cos(e + f*x)/f + A*a*c*d*x*sin(e + f*x)**2 + A*a*c*d*x*cos(e + f*x)**2 - A*a*
c*d*sin(e + f*x)*cos(e + f*x)/f - 2*A*a*c*d*cos(e + f*x)/f + A*a*d**2*x*sin(e + f*x)**2/2 + A*a*d**2*x*cos(e +
 f*x)**2/2 - A*a*d**2*sin(e + f*x)**2*cos(e + f*x)/f - A*a*d**2*sin(e + f*x)*cos(e + f*x)/(2*f) - 2*A*a*d**2*c
os(e + f*x)**3/(3*f) + B*a*c**2*x*sin(e + f*x)**2/2 + B*a*c**2*x*cos(e + f*x)**2/2 - B*a*c**2*sin(e + f*x)*cos
(e + f*x)/(2*f) - B*a*c**2*cos(e + f*x)/f + B*a*c*d*x*sin(e + f*x)**2 + B*a*c*d*x*cos(e + f*x)**2 - 2*B*a*c*d*
sin(e + f*x)**2*cos(e + f*x)/f - B*a*c*d*sin(e + f*x)*cos(e + f*x)/f - 4*B*a*c*d*cos(e + f*x)**3/(3*f) + 3*B*a
*d**2*x*sin(e + f*x)**4/8 + 3*B*a*d**2*x*sin(e + f*x)**2*cos(e + f*x)**2/4 + 3*B*a*d**2*x*cos(e + f*x)**4/8 -
5*B*a*d**2*sin(e + f*x)**3*cos(e + f*x)/(8*f) - B*a*d**2*sin(e + f*x)**2*cos(e + f*x)/f - 3*B*a*d**2*sin(e + f
*x)*cos(e + f*x)**3/(8*f) - 2*B*a*d**2*cos(e + f*x)**3/(3*f), Ne(f, 0)), (x*(A + B*sin(e))*(c + d*sin(e))**2*(
a*sin(e) + a), True))

________________________________________________________________________________________

Giac [A]  time = 1.13262, size = 267, normalized size = 1.25 \begin{align*} \frac{B a d^{2} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} + \frac{1}{8} \,{\left (8 \, A a c^{2} + 4 \, B a c^{2} + 8 \, A a c d + 8 \, B a c d + 4 \, A a d^{2} + 3 \, B a d^{2}\right )} x + \frac{{\left (2 \, B a c d + A a d^{2} + B a d^{2}\right )} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac{{\left (4 \, A a c^{2} + 4 \, B a c^{2} + 8 \, A a c d + 6 \, B a c d + 3 \, A a d^{2} + 3 \, B a d^{2}\right )} \cos \left (f x + e\right )}{4 \, f} - \frac{{\left (B a c^{2} + 2 \, A a c d + 2 \, B a c d + A a d^{2} + B a d^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))*(A+B*sin(f*x+e))*(c+d*sin(f*x+e))^2,x, algorithm="giac")

[Out]

1/32*B*a*d^2*sin(4*f*x + 4*e)/f + 1/8*(8*A*a*c^2 + 4*B*a*c^2 + 8*A*a*c*d + 8*B*a*c*d + 4*A*a*d^2 + 3*B*a*d^2)*
x + 1/12*(2*B*a*c*d + A*a*d^2 + B*a*d^2)*cos(3*f*x + 3*e)/f - 1/4*(4*A*a*c^2 + 4*B*a*c^2 + 8*A*a*c*d + 6*B*a*c
*d + 3*A*a*d^2 + 3*B*a*d^2)*cos(f*x + e)/f - 1/4*(B*a*c^2 + 2*A*a*c*d + 2*B*a*c*d + A*a*d^2 + B*a*d^2)*sin(2*f
*x + 2*e)/f